package com.patterns.prototype.commomPrototyoe.shallowPrototype;

import java.util.ArrayList;

/**
 * Created by Xiao Yiyun on 2017/4/25.
 */
public class TClass {

    //定义一个私有变量
    private ArrayList<String> arrayList = new ArrayList<String>();

    public TClass clone() {
        TClass tClass = null;
        try {
            tClass = (TClass)super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return tClass;
    }

    public ArrayList<String> getArrayList() {
        return arrayList;
    }

    public void setArrayList(ArrayList<String> arrayList) {
        this.arrayList = arrayList;
    }

    public void setValue(String str) {
        this.arrayList.add(str);
    }
}
